package com.redlight.config;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.web.servlet.ServletRegistrationBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.DispatcherServlet;
//
//import javax.servlet.MultipartConfigElement;
//
///**
// * Created by chao on 2019/1/21.
// */
//@Configuration
//public class DispatcherServletConfig {
//    @Autowired
//    private MultipartConfigElement multipartConfigElement;
//    @Autowired
//    private DispatcherServlet dispatcherServlet;
//    @Bean
//    public ServletRegistrationBean apiServlet() {
//        ServletRegistrationBean bean = new ServletRegistrationBean(dispatcherServlet);
//        //注入上传配置到自己注册的ServletRegistrationBean
//        bean.addUrlMappings("/");
//        bean.setMultipartConfig(multipartConfigElement);
//        bean.setName("apiServlet");
//        return bean;
//    }
//
//}
